Efficiently storing indented threads in a threaded discussion application

ABSTRACT

A method, apparatus, and computer-readable media for retrieving records in a hierarchical set of the records having a plurality of hierarchical levels and a plurality of hierarchical depths, each of the records having a tag that is unique within the hierarchical set of the records, comprises identifying one of the records in the hierarchical set of the records; modifying the tag, thereby producing a key; indexing the hierarchical set of the records only once, thereby selecting one or more of the records within the hierarchical set of the records, wherein indexing the hierarchical set of the records only once comprises applying the key to the hierarchical set of the records; and retrieving the selected records.

BACKGROUND

[0001] The present invention relates generally to data management, andparticularly to managing data stored hierarchically.

[0002] Hierarchical data sets are useful and popular. Such data sets aregenerally composed of multiple records. In a hierarchical set ofrecords, a record can have multiple “children,” which are related to therecord and exist at a lower level of the hierarchy. Such a record isreferred to as the “parent” record of the children records. The childrenof a record may have children, and so on, limited only by the size ofthe database. Within a set of children of a single record, it is oftenuseful to order the children, such that there is a first child, a secondchild, and so on.

[0003] To date the utility of these hierarchical data sets has beenlimited by the efficiency of the tools available for managing the data.Conventional methods of storing hierarchical data in a database involvemultiple expensive calls to update and/or query the database. Forexample, in order to select the second grandchild of a record, threequeries are necessary. The first query selects the child of the record.The second query selects the first child of the child. The third queryselects the second child of the child.

SUMMARY

[0004] In general, in one aspect, the invention features a method,apparatus, and computer-readable media for retrieving records in ahierarchical set of the records having a plurality of hierarchicallevels and a plurality of hierarchical depths, each of the recordshaving a tag that is unique within the hierarchical set of the records.It comprises identifying one of the records in the hierarchical set ofthe records; modifying the tag, thereby producing a key; indexing thehierarchical set of the records only once, thereby selecting one or moreof the records within the hierarchical set of the records, whereinindexing the hierarchical set of the records only once comprisesapplying the key to the hierarchical set of the records; and retrievingthe selected records.

[0005] Particular implementations can include one or more of thefollowing features. Applying comprises selecting those of the records inthe hierarchical set of the records having a tag that matches the key.Identifying one of the records comprises receiving a selection of theone of the records from a user; and receiving a command from the user;and wherein modifying the tag is based on the command from the user.Each of the records has one or more fields, and implementations cancomprise displaying a field of each of the retrieved records on adisplay, wherein the position of each of the fields on the displayrepresents the hierarchical depth and hierarchical level of thecorresponding one of the retrieved records. Each tag is a number havinga plurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; and modifying the tag comprisesselecting at least one of the digits according to the command from theuser; and changing the value of the selected digits according to thecommand from the user. Each tag is a number having a plurality ofdigits; the position of each of the digits represents one of thehierarchical depths; the value of each of the digits represents one ofthe hierarchical levels; the command from the user requests retrievingthe children of the identified record; and modifying the tag comprisesselecting the digit corresponding to the hierarchical depth of theidentified record; and setting the value of each digit corresponding toa hierarchical depth below the hierarchical depth corresponding to theselected digit to a wildcard value. Each tag is a number having aplurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; the command from the user requestsretrieving the parent of the identified record; and modifying the tagcomprises selecting the digit corresponding to the hierarchical depth ofthe identified record; and setting the value of the selected digit to anull value. Each of the records represents one of a message and afolder.

[0006] In general, in one aspect, the invention features a method,apparatus, and computer-readable media for adding a new record to ahierarchical set of records having a plurality of hierarchical levelsand a plurality of hierarchical depths, each of the records in thehierarchical set of records having a tag that is unique within thehierarchical set of records. It comprises identifying one of the recordsin the hierarchical set of records as the parent of the new record;modifying the tag, thereby producing a key; adding the key to the newrecord; and indexing the hierarchical set of records only once, therebyadding the new record to the hierarchical set of records, whereinindexing the hierarchical set of records only once comprises applyingthe key to the hierarchical set of records.

[0007] Particular implementations can include one or more of thefollowing features. Identifying one of the records comprises receiving aselection of the one of the records from a user. Each tag is a numberhaving a plurality of digits; the position of each of the digitsrepresents one of the hierarchical depths; the value of each of thedigits represents one of the hierarchical levels; the identified recordrepresents a message; identifying one of the records further comprisesreceiving a command from the user that requests replying to the message;and modifying the tag comprises selecting the digit corresponding to thehierarchical depth immediately below the hierarchical depth of theidentified record; and incrementing the value of the selected digit.Applying comprises selecting those of the records in the hierarchicalset of the records having a tag that matches the key. Each tag includesa plurality of digits; the position of each of the digits represents oneof the hierarchical depths; and the value of each of the digitsrepresents one of the hierarchical levels.

[0008] In general, in one aspect, the invention features a method,apparatus, and computer-readable media for selecting records in ahierarchical set of the records having a plurality of hierarchicallevels and a plurality of hierarchical depths, each of the recordshaving a tag that is unique within the hierarchical set of the records.It comprises identifying one of the records in the hierarchical set ofthe records; modifying the tag; and indexing the hierarchical set of therecords only once, thereby selecting one or more of the records withinthe hierarchical set of the records, wherein indexing the hierarchicalset of the records only once comprises applying the modified tag to thehierarchical set of the record.

[0009] Particular implementations can include one or more of thefollowing features. Each tag includes a plurality of digits; theposition of each of the digits represents one of the hierarchicaldepths; and the value of each of the digits represents one of thehierarchical levels. Applying comprises selecting those of the recordsin the hierarchical set of the records having a tag that matches thekey.

[0010] Advantages that can be seen in implementations of the inventioninclude one or more of the following. Implementations of the presentinvention permit manipulation of a database representing an indentedthreaded discussion with only a single access of the database. Forexamples, messages can be added, deleted, and retrieved through a singledatabase access such as a query or call.

[0011] The details of one or more implementations are set forth in theaccompanying drawings and the description below. Other features will beapparent from the description and drawings, and from the claims.

DESCRIPTION OF DRAWINGS

[0012]FIG. 1 shows a display of an indented threaded discussion.

[0013]FIG. 2 is a flowchart of a process for retrieving the parent of amessage in an indented threaded discussion according to oneimplementation.

[0014]FIG. 3 is a flowchart of a process for retrieving the children ofa message in an indented threaded discussion according to oneimplementation.

[0015]FIG. 4 is a flowchart of a process for adding a message to anindented threaded discussion according to one implementation.

[0016] The leading digit(s) of each reference numeral used in thisspecification indicates the number of the drawing in which the referencenumeral first appears.

DETAILED DESCRIPTION

[0017] One common type of hierarchical data is an indented threadeddiscussion. Originally found only in Internet newsgroups, indentedthreaded discussions have found increasing popularity as a way to manageand display a discussion among multiple participants. Indented threadeddiscussion management tools are now found in consumer products such aselectronic mail software programs.

[0018]FIG. 1 shows a display of an indented threaded discussion. Anindented threaded discussion begins when a user posts a message 102 in aforum available to multiple users, where the posted message is not areply to another message. Such a message is referred to herein as the“origin” message of the discussion. Any origin message constitutes the“head” of a thread. Thus message 102 is both the origin message of adiscussion and the head of a thread. All replies to a message are partof the thread. Of course, a forum can have multiple discussions.

[0019] When a user posts a reply to a message, the reply is generallydisplayed underneath the message, and indented once. Any message havingreplies to it is the head of a thread. Thus a discussion can have manythreads. The head of thread is indented once relative to the message towhich it replies.

[0020] Message 104 is a reply to message 102. Therefore, reply 104 isdisplayed underneath message 102, and indented once, as shown in FIG. 1.A reply 106 to the reply 104 is indented once further. A reply 108 tothe reply 106 to the reply 104 is indented once further still.

[0021] When a user posts another reply 110 to origin message 102, it isshown indented only once, and is shown beneath message 104 and itschildren 106 and 108. A subsequent reply 112 to origin message 102 isalso shown indented once, and is shown beneath message 110. A reply 114to message 112 is shown indented twice and beneath message 112.

[0022] A display such as the display of FIG. 1 allows a user to rapidlyunderstand the structure of the discussion hierarchy and the place eachmessage has in the hierarchy. The place a message has in the hierarchycan be described in terms of two dimensions of the hierarchy: level anddepth. The depth of a message is the number of threads that contain themessage. For example, referring to FIG. 1, the depth of message 108 isthree because it is contained by the threads headed by messages 106, 104and 102. The depth of an origin message such as message 102 is zero.

[0023] The level of a message at a particular depth represents thenumber of messages at that particular depth that precede that message.For example, referring to FIG. 1, the level of message 112 is threebecause it has a depth of one and is preceded by messages 110 and 104,both also at a depth of one. The order of precedence within eachhierarchical depth can be determined by any number of factors orcombinations thereof. In a threaded discussion group, the chronologicalorder of the messages, as determined by the time and date of the postingof each message, is most commonly used. When the records in thehierarchical data set represent containers such as folders, thealphabetical order of the names of the folders can be used. In addition,the user of the display may select any field in the records, and therebycause the contents of that field to determine the order of precedence.The level of an origin message such as message 102 is zero.

[0024] Referring again to FIG. 1, messages at a single hierarchicallevel, such as messages 104, 110, and 112, are shown in chronologicalorder, while the children of a message (that is, replies to the message,replies to those replies, and so on) are shown beneath the message andabove the next message at the same hierarchical level. The messagesdisplayed to the user are generally stored in some sort of database suchas a table. Each row of the table represents a message. Each message hasmultiple fields such as subject, author, text, date of posting, and soon. Each column represents one of the fields.

[0025] Conventional tools for managing such indented threadeddiscussions are notoriously inefficient. Normally either multiple rowsof the table must be updated upon the creation of a new message ormultiple queries have to be performed to display an indented thread. Thenumber of rows needing updates could be as large as the number ofmessages in the thread.

[0026] Implementations of the present invention associate a tag witheach record in a hierarchical set of records, such that the tag isunique within the hierarchical set of records. The tag is generally oneof the fields of the records. Table 1 depicts a portion of a databasetable representing the discussion of FIG. 1 according to oneimplementation. TABLE 1 Tag Depth Level Subject 0000 0 0 Bike Rides inthe Bay Area 1000 1 1 Old La Honda 1100 2 1 re: Old La Honda 1110 3 1re: re: Old La Honda 2000 1 2 Page Mill Road 3000 1 3 The Bears Loop3100 2 1 re: The Bears Loop

[0027] Each tag is a number having a plurality of digits, one for eachof the depths of the hierarchy. The hierarchy of Table 1 has fourdepths; thus each tag has four digits. In one implementation, the digitsare arranged so that the most significant digit represents the firstdepth of the hierarchy (that is, the depth of the origin message), thenext most significant digit represents the second depth of thehierarchy, and so on. Other implementations employ other arrangements ofthe digits.

[0028] The value of each digit represents a level in the hierarchy.Assume the hierarchy of Table 1 has four levels. Then each digit canhave a values ranging from zero to three. A value of zero indicates thatthe message does not exist at that depth in the hierarchy. Of course,other ranges of levels and depths can be supported, as will be apparentto one skilled in the relevant art after reading this description. Oneimplementation supports 16 levels and 16 depths. In that implementation,the tag is a 16-digit hexadecimal number represented by a “big int,” asigned 64-bit number having values ranging from −2⁶³ to 2⁶³.

[0029] Each tag uniquely identifies the position of its record in thehierarchy. For example, the tag “3100” shows that the record is thefirst child of the third child of the origin message.

[0030] One advantage of the disclosed tag is that the tag of a recordmay be determined quickly and easily, without indexing the database, bymodifying the tag of a related record.

[0031]FIG. 2 is a flowchart of a process 200 for retrieving the parentof a message in an indented threaded discussion according to oneimplementation. Process 200 receives a command from a user (step 202).The command identifies message 108 and requests retrieving the parent ofmessage 108. Process 200 modifies the tag of message 108 to produce akey. To do this, process 200 first selects the digit corresponding tothe hierarchical depth of message 108 (step 204). Referring to Table 1,message 108 has a depth of three. Therefore, process 200 selects thethird most significant digit of the tag of message 108. The depth ofeach message need not be stored in the table, but can be determined inreal time, with knowledge of the hierarchical depth represented by eachdigit. Where tags have digits arranged according to increasing depths inthe hierarchy, such as the tags of Table 1, one can select the digitcorresponding to the hierarchical depth of a message by simply selectthe least significant non-zero digit.

[0032] Process 200 then sets the value of the selected digit to a nullvalue (step 206). In the tags of Table 1, the null value is zero. Ofcourse, other values can be selected as the null value. The resultingkey is “1100”, which is the tag of message 106, the parent of message108. Process 200 then indexes the database only once by applying the keyto the database (step 208), thereby selecting the record for message106. Process 200 then retrieves message 106 (step 210) and displaysmessage 106 to the user (step 212).

[0033]FIG. 3 is a flowchart of a process 300 for retrieving the childrenof a message in an indented threaded discussion according to oneimplementation. Process 300 receives a command from a user (step 302).The command identifies message 104 and requests retrieving all of themessages in the thread for which message 104 is the head. These messagesinclude the children of message 104, the children of the children ofmessage 104, and so on.

[0034] Process 300 modifies the tag of message 104 to produce a key. Todo this, process 300 first selects the digit corresponding to thehierarchical depth of message 104 (step 304). Referring to Table 1,message 104 has a depth of one. Therefore, process 300 selects the mostsignificant digit of the tag of message 104. Process 300 then sets thevalue of each digit corresponding to a hierarchical depth below thehierarchical depth of the selected digit to a wildcard value (step 308).The resulting key is “1XXX”, where “X” represents a wildcard value thatcan match any value.

[0035] In one implementation, applying a key to the database selects allrecords in the database having tags that match the key. Process 300indexes the database only once by applying the key to the database (step310), thereby selecting the records for the messages in the threadheaded by message 104. Referring to Table 1, the key “1XXX” matches thetags for records corresponding to messages 106 and 108. Process 300 thenretrieves messages 106 and 108 (step 312) and displays messages 106 and108 to the user (step 314).

[0036] Process 300 can also be used to delete a message. When a messageis deleted, so are all of its children. Process 300 selects a messageand all of its children. The records corresponding to the selectedmessages are then deleted.

[0037]FIG. 4 is a flowchart of a process 400 for adding a message to anindented threaded discussion according to one implementation. Process400 receives a command from a user (step 402). The command identifiesmessage 114 and requests replying to message 114. Process 400 modifiesthe tag of message 114 to produce a key. To do this, process 400 firstselects the digit corresponding to the hierarchical depth immediatelybelow the hierarchical depth of message 114 (step 404). Referring toTable 1, message 114 has a depth of two. Therefore, process 400 selectsthe third most significant digit of the tag of message 104. Process 400then increments the value of selected digit (step 406). The resultingkey is “3110”. Process 400 then indexes the database only once by addinga record to the database having the key as its tag (step 408). Therecord corresponds to the new message.

[0038] The invention can be implemented in digital electronic circuitry,or in computer hardware, firmware, software, or in combinations of them.Apparatus of the invention can be implemented in a computer programproduct tangibly embodied in a machine-readable storage device forexecution by a programmable processor; and method steps of the inventioncan be performed by a programmable processor executing a program ofinstructions to perform functions of the invention by operating on inputdata and generating output. The invention can be implementedadvantageously in one or more computer programs that are executable on aprogrammable system including at least one programmable processorcoupled to receive data and instructions from, and to transmit data andinstructions to, a data storage system, at least one input device, andat least one output device. Each computer program can be implemented ina high-level procedural or object-oriented programming language, or inassembly or machine language if desired; and in any case, the languagecan be a compiled or interpreted language. Suitable processors include,by way of example, both general and special purpose microprocessors.Generally, a processor will receive instructions and data from aread-only memory and/or a random access memory. Generally, a computerwill include one or more mass storage devices for storing data files;such devices include magnetic disks, such as internal hard disks andremovable disks; magneto-optical disks; and optical disks. Storagedevices suitable for tangibly embodying computer program instructionsand data include all forms of non-volatile memory, including by way ofexample semiconductor memory devices, such as EPROM, EEPROM, and flashmemory devices; magnetic disks such as internal hard disks and removabledisks; magneto-optical disks; and CD-ROM disks. Any of the foregoing canbe supplemented by, or incorporated in, ASICs (application-specificintegrated circuits).

[0039] A number of implementations of the invention have been described.Nevertheless, it will be understood that various modifications may bemade without departing from the spirit and scope of the invention.Accordingly, other implementations are within the scope of the followingclaims.

What is claimed is:
 1. A method for retrieving records in a hierarchicalset of the records having a plurality of hierarchical levels and aplurality of hierarchical depths, each of the records having a tag thatis unique within the hierarchical set of the records, the methodcomprising: identifying one of the records in the hierarchical set ofthe records; modifying the tag, thereby producing a key; indexing thehierarchical set of the records only once, thereby selecting one or moreof the records within the hierarchical set of the records, whereinindexing the hierarchical set of the records only once comprisesapplying the key to the hierarchical set of the records; and retrievingthe selected records.
 2. The method of claim 1, wherein applyingcomprises: selecting those of the records in the hierarchical set of therecords having a tag that matches the key.
 3. The method of claim 2,wherein identifying one of the records comprises: receiving a selectionof the one of the records from a user; and receiving a command from theuser; and wherein modifying the tag is based on the command from theuser.
 4. The method of claim 3, wherein each of the records has one ormore fields, further comprising: displaying a field of each of theretrieved records on a display, wherein the position of each of thefields on the display represents the hierarchical depth and hierarchicallevel of the corresponding one of the retrieved records.
 5. The methodof claim 2, wherein: each tag is a number having a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; the value of each of the digits represents one of thehierarchical levels; and modifying the tag comprises: selecting at leastone of the digits according to the command from the user; and changingthe value of the selected digits according to the command from the user.6. The method of claim 2, wherein: each tag is a number having aplurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; the command from the user requestsretrieving the children of the identified record; and modifying the tagcomprises: selecting the digit corresponding to the hierarchical depthof the identified record; and setting the value of each digitcorresponding to a hierarchical depth below the hierarchical depthcorresponding to the selected digit to a wildcard value.
 7. The methodof claim 2, wherein: each tag is a number having a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; the value of each of the digits represents one of thehierarchical levels; the command from the user requests retrieving theparent of the identified record; and modifying the tag comprises:selecting the digit corresponding to the hierarchical depth of theidentified record; and setting the value of the selected digit to a nullvalue.
 8. The method of claim 2, wherein each of the records representsone of a message and a folder.
 9. A method for adding a new record to ahierarchical set of records having a plurality of hierarchical levelsand a plurality of hierarchical depths, each of the records in thehierarchical set of records having a tag that is unique within thehierarchical set of records, the method comprising: identifying one ofthe records in the hierarchical set of records as the parent of the newrecord; modifying the tag, thereby producing a key; adding the key tothe new record; and indexing the hierarchical set of records only once,thereby adding the new record to the hierarchical set of records,wherein indexing the hierarchical set of records only once comprisesapplying the key to the hierarchical set of records.
 10. The method ofclaim 9, wherein identifying one of the records comprises: receiving aselection of the one of the records from a user.
 11. The method of claim10, wherein: each tag is a number having a plurality of digits; theposition of each of the digits represents one of the hierarchicaldepths; the value of each of the digits represents one of thehierarchical levels; the identified record represents a message;identifying one of the records further comprises receiving a commandfrom the user that requests replying to the message; and modifying thetag comprises: selecting the digit corresponding to the hierarchicaldepth immediately below the hierarchical depth of the identified record;and incrementing the value of the selected digit.
 12. The method ofclaim 9, wherein applying comprises: selecting those of the records inthe hierarchical set of the records having a tag that matches the key.13. The method of claim 9, wherein: each tag includes a plurality ofdigits; the position of each of the digits represents one of thehierarchical depths; and the value of each of the digits represents oneof the hierarchical levels.
 14. A method for selecting records in ahierarchical set of the records having a plurality of hierarchicallevels and a plurality of hierarchical depths, each of the recordshaving a tag that is unique within the hierarchical set of the records,the method comprising: identifying one of the records in thehierarchical set of the records; modifying the tag; and indexing thehierarchical set of the records only once, thereby selecting one or moreof the records within the hierarchical set of the records, whereinindexing the hierarchical set of the records only once comprisesapplying the modified tag to the hierarchical set of the record.
 15. Themethod of claim 14, wherein: each tag includes a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; and the value of each of the digits represents one of thehierarchical levels.
 16. The method of claim 14, wherein applyingcomprises: selecting those of the records in the hierarchical set of therecords having a tag that matches the key.
 17. At least one computerprogrammed to execute a process for retrieving records in a hierarchicalset of the records having a plurality of hierarchical levels and aplurality of hierarchical depths, each of the records having a tag thatis unique within the hierarchical set of the records, the processcomprising: identifying one of the records in the hierarchical set ofthe records; modifying the tag, thereby producing a key; indexing thehierarchical set of the records only once, thereby selecting one or moreof the records within the hierarchical set of the records, whereinindexing the hierarchical set of the records only once comprisesapplying the key to the hierarchical set of the records; and retrievingthe selected records.
 18. The computer of claim 17, wherein applyingcomprises: selecting those of the records in the hierarchical set of therecords having a tag that matches the key.
 19. The computer of claim 18,wherein identifying one of the records comprises: receiving a selectionof the one of the records from a user; and receiving a command from theuser; and wherein modifying the tag is based on the command from theuser.
 20. The computer of claim 19, wherein each of the records has oneor more fields, and the process further comprises: displaying a field ofeach of the retrieved records on a display, wherein the position of eachof the fields on the display represents the hierarchical depth andhierarchical level of the corresponding one of the retrieved records.21. The computer of claim 18, wherein: each tag is a number having aplurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; and modifying the tag comprises:selecting at least one of the digits according to the command from theuser; and changing the value of the selected digits according to thecommand from the user.
 22. The computer of claim 18, wherein: each tagis a number having a plurality of digits; the position of each of thedigits represents one of the hierarchical depths; the value of each ofthe digits represents one of the hierarchical levels; the command fromthe user requests retrieving the children of the identified record; andmodifying the tag comprises: selecting the digit corresponding to thehierarchical depth of the identified record; and setting the value ofeach digit corresponding to a hierarchical depth below the hierarchicaldepth corresponding to the selected digit to a wildcard value.
 23. Thecomputer of claim 18, wherein: each tag is a number having a pluralityof digits; the position of each of the digits represents one of thehierarchical depths; the value of each of the digits represents one ofthe hierarchical levels; the command from the user requests retrievingthe parent of the identified record; and modifying the tag comprises:selecting the digit corresponding to the hierarchical depth of theidentified record; and setting the value of the selected digit to a nullvalue.
 24. The computer of claim 18, wherein each of the recordsrepresents one of a message and a folder.
 25. At least one computerprogrammed to execute a process for adding a new record to ahierarchical set of records having a plurality of hierarchical levelsand a plurality of hierarchical depths, each of the records in thehierarchical set of records having a tag that is unique within thehierarchical set of records, the process comprising: identifying one ofthe records in the hierarchical set of records as the parent of the newrecord; modifying the tag, thereby producing a key; adding the key tothe new record; and indexing the hierarchical set of records only once,thereby adding the new record to the hierarchical set of records,wherein indexing the hierarchical set of records only once comprisesapplying the key to the hierarchical set of records.
 26. The computer ofclaim 25, wherein identifying one of the records comprises: receiving aselection of the one of the records from a user.
 27. The computer ofclaim 26, wherein: each tag is a number having a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; the value of each of the digits represents one of thehierarchical levels; the identified record represents a message;identifying one of the records further comprises receiving a commandfrom the user that requests replying to the message; and modifying thetag comprises: selecting the digit corresponding to the hierarchicaldepth immediately below the hierarchical depth of the identified record;and incrementing the value of the selected digit.
 28. The computer ofclaim 25, wherein applying comprises: selecting those of the records inthe hierarchical set of the records having a tag that matches the key.29. The computer of claim 25, wherein: each tag includes a plurality ofdigits; the position of each of the digits represents one of thehierarchical depths; and the value of each of the digits represents oneof the hierarchical levels.
 30. At least one computer programmed toexecute a process for selecting records in a hierarchical set of therecords having a plurality of hierarchical levels and a plurality ofhierarchical depths, each of the records having a tag that is uniquewithin the hierarchical set of the records, the process comprising:identifying one of the records in the hierarchical set of the records;modifying the tag; and indexing the hierarchical set of the records onlyonce, thereby selecting one or more of the records within thehierarchical set of the records, wherein indexing the hierarchical setof the records only once comprises applying the modified tag to thehierarchical set of the record.
 31. The computer of claim 30, wherein:each tag includes a plurality of digits; the position of each of thedigits represents one of the hierarchical depths; and the value of eachof the digits represents one of the hierarchical levels.
 32. Thecomputer of claim 30, wherein applying comprises: selecting those of therecords in the hierarchical set of the records having a tag that matchesthe key.
 33. An apparatus for retrieving records in a hierarchical setof the records having a plurality of hierarchical levels and a pluralityof hierarchical depths, each of the records having a tag that is uniquewithin the hierarchical set of the records, the apparatus comprising:means for identifying one of the records in the hierarchical set of therecords; means for modifying the tag, thereby producing a key; means forindexing the hierarchical set of the records only once, therebyselecting one or more of the records within the hierarchical set of therecords, wherein indexing the hierarchical set of the records only oncecomprises applying the key to the hierarchical set of the records; andmeans for retrieving the selected records.
 34. The apparatus of claim33, wherein means for applying comprises: means for selecting those ofthe records in the hierarchical set of the records having a tag thatmatches the key.
 35. The apparatus of claim 34, wherein means foridentifying one of the records comprises: means for receiving aselection of the one of the records from a user; and means for receivinga command from the user; and wherein modifying the tag is based on thecommand from the user.
 36. The apparatus of claim 35, wherein each ofthe records has one or more fields, further comprising: means fordisplaying a field of each of the retrieved records on a display,wherein the position of each of the fields on the display represents thehierarchical depth and hierarchical level of the corresponding one ofthe retrieved records.
 37. The apparatus of claim 34, wherein: each tagis a number having a plurality of digits; the position of each of thedigits represents one of the hierarchical depths; the value of each ofthe digits represents one of the hierarchical levels; and means formodifying the tag comprises: means for selecting at least one of thedigits according to the command from the user; and means for changingthe value of the selected digits according to the command from the user.38. The apparatus of claim 34, wherein: each tag is a number having aplurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; the command from the user requestsretrieving the children of the identified record; and means formodifying the tag comprises: means for selecting the digit correspondingto the hierarchical depth of the identified record; and means forsetting the value of each digit corresponding to a hierarchical depthbelow the hierarchical depth corresponding to the selected digit to awildcard value.
 39. The apparatus of claim 34, wherein: each tag is anumber having a plurality of digits; the position of each of the digitsrepresents one of the hierarchical depths; the value of each of thedigits represents one of the hierarchical levels; the command from theuser requests retrieving the parent of the identified record; and meansfor modifying the tag comprises: means for selecting the digitcorresponding to the hierarchical depth of the identified record; andmeans for setting the value of the selected digit to a null value. 40.The apparatus of claim 34, wherein each of the records represents one ofa message and a folder.
 41. An apparatus for adding a new record to ahierarchical set of records having a plurality of hierarchical levelsand a plurality of hierarchical depths, each of the records in thehierarchical set of records having a tag that is unique within thehierarchical set of records, the apparatus comprising: means foridentifying one of the records in the hierarchical set of records as theparent of the new record; means for modifying the tag, thereby producinga key; means for adding the key to the new record; and means forindexing the hierarchical set of records only once, thereby adding thenew record to the hierarchical set of records, wherein means forindexing the hierarchical set of records only once comprises means forapplying the key to the hierarchical set of records.
 42. The apparatusof claim 41, wherein means for identifying one of the records comprises:means for receiving a selection of the one of the records from a user.43. The apparatus of claim 42, wherein: each tag is a number having aplurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; the identified record represents amessage; means for identifying one of the records further comprisesmeans for receiving a command from the user that requests replying tothe message; and means for modifying the tag comprises: means forselecting the digit corresponding to the hierarchical depth immediatelybelow the hierarchical depth of the identified record; and means forincrementing the value of the selected digit.
 44. The apparatus of claim41, wherein means for applying comprises: means for selecting those ofthe records in the hierarchical set of the records having a tag thatmatches the key.
 45. The apparatus of claim 41, wherein: each tagincludes a plurality of digits; the position of each of the digitsrepresents one of the hierarchical depths; and the value of each of thedigits represents one of the hierarchical levels.
 46. An apparatus forselecting records in a hierarchical set of the records having aplurality of hierarchical levels and a plurality of hierarchical depths,each of the records having a tag that is unique within the hierarchicalset of the records, the apparatus comprising: means for identifying oneof the records in the hierarchical set of the records; means formodifying the tag; and means for indexing the hierarchical set of therecords only once, thereby selecting one or more of the records withinthe hierarchical set of the records, wherein means for indexing thehierarchical set of the records only once comprises means for applyingthe modified tag to the hierarchical set of the record.
 47. Theapparatus of claim 46, wherein: each tag includes a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; and the value of each of the digits represents one of thehierarchical levels.
 48. The apparatus of claim 46, wherein means forapplying comprises: means for selecting those of the records in thehierarchical set of the records having a tag that matches the key. 49.Computer-readable media embodying instructions executable by a computerto perform a method for retrieving records in a hierarchical set of therecords having a plurality of hierarchical levels and a plurality ofhierarchical depths, each of the records having a tag that is uniquewithin the hierarchical set of the records, the method comprising:identifying one of the records in the hierarchical set of the records;modifying the tag, thereby producing a key; indexing the hierarchicalset of the records only once, thereby selecting one or more of therecords within the hierarchical set of the records, wherein indexing thehierarchical set of the records only once comprises applying the key tothe hierarchical set of the records; and retrieving the selectedrecords.
 50. The media of claim 49, wherein applying comprises:selecting those of the records in the hierarchical set of the recordshaving a tag that matches the key.
 51. The media of claim 50, whereinidentifying one of the records comprises: receiving a selection of theone of the records from a user; and receiving a command from the user;and wherein modifying the tag is based on the command from the user. 52.The media of claim 51, wherein each of the records has one or morefields, the method further comprising: displaying a field of each of theretrieved records on a display, wherein the position of each of thefields on the display represents the hierarchical depth and hierarchicallevel of the corresponding one of the retrieved records.
 53. The mediaof claim 50, wherein: each tag is a number having a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; the value of each of the digits represents one of thehierarchical levels; and modifying the tag comprises: selecting at leastone of the digits according to the command from the user; and changingthe value of the selected digits according to the command from the user.54. The media of claim 50, wherein: each tag is a number having aplurality of digits; the position of each of the digits represents oneof the hierarchical depths; the value of each of the digits representsone of the hierarchical levels; the command from the user requestsretrieving the children of the identified record; and modifying the tagcomprises: selecting the digit corresponding to the hierarchical depthof the identified record; and setting the value of each digitcorresponding to a hierarchical depth below the hierarchical depthcorresponding to the selected digit to a wildcard value.
 55. The mediaof claim 50, wherein: each tag is a number having a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; the value of each of the digits represents one of thehierarchical levels; the command from the user requests retrieving theparent of the identified record; and modifying the tag comprises:selecting the digit corresponding to the hierarchical depth of theidentified record; and setting the value of the selected digit to a nullvalue.
 56. The media of claim 50, wherein each of the records representsone of a message and a folder.
 57. Computer-readable media embodyinginstructions executable by a computer to perform a method for adding anew record to a hierarchical set of records having a plurality ofhierarchical levels and a plurality of hierarchical depths, each of therecords in the hierarchical set of records having a tag that is uniquewithin the hierarchical set of records, the method comprising:identifying one of the records in the hierarchical set of records as theparent of the new record; modifying the tag, thereby producing a key;adding the key to the new record; and indexing the hierarchical set ofrecords only once, thereby adding the new record to the hierarchical setof records, wherein indexing the hierarchical set of records only oncecomprises applying the key to the hierarchical set of records.
 58. Themedia of claim 57, wherein identifying one of the records comprises:receiving a selection of the one of the records from a user.
 59. Themedia of claim 58, wherein: each tag is a number having a plurality ofdigits; the position of each of the digits represents one of thehierarchical depths; the value of each of the digits represents one ofthe hierarchical levels; the identified record represents a message;identifying one of the records further comprises receiving a commandfrom the user that requests replying to the message; and modifying thetag comprises: selecting the digit corresponding to the hierarchicaldepth immediately below the hierarchical depth of the identified record;and incrementing the value of the selected digit.
 60. The media of claim57, wherein applying comprises: selecting those of the records in thehierarchical set of the records having a tag that matches the key. 61.The media of claim 57, wherein: each tag includes a plurality of digits;the position of each of the digits represents one of the hierarchicaldepths; and the value of each of the digits represents one of thehierarchical levels.
 62. Computer-readable media embodying instructionsexecutable by a computer to perform a method for selecting records in ahierarchical set of the records having a plurality of hierarchicallevels and a plurality of hierarchical depths, each of the recordshaving a tag that is unique within the hierarchical set of the records,the method comprising: identifying one of the records in thehierarchical set of the records; modifying the tag; and indexing thehierarchical set of the records only once, thereby selecting one or moreof the records within the hierarchical set of the records, whereinindexing the hierarchical set of the records only once comprisesapplying the modified tag to the hierarchical set of the record.
 63. Themedia of claim 62, wherein: each tag includes a plurality of digits; theposition of each of the digits represents one of the hierarchicaldepths; and the value of each of the digits represents one of thehierarchical levels.
 64. The media of claim 62, wherein applyingcomprises: selecting those of the records in the hierarchical set of therecords having a tag that matches the key.
 65. A method of tagging adatum in a hierarchical data set having a plurality of hierarchicallevels and a plurality of hierarchical depths, the method comprising:determining a hierarchical level of the datum; determining ahierarchical depth of the datum; and assigning a tag to the datum,comprising: determining the immediate parent of the datum; selecting atag of the immediate parent of the datum, wherein the tag is a numberhaving multiple digits each representing one of the hierarchical depthsof the hierarchical data set; selecting a digit of the selected tag thatrepresents the hierarchical depth of the datum; assigning a value to theselected digit, the value representing the hierarchical level of thedatum.
 66. The method of claim 65, wherein assigning a value to theselected digit comprises: determining the number of children of theimmediate parent of the datum that have already been tagged;incrementing the number of children to obtain an incremented number; andsetting the value of the selected digit to equal the value of theincremented number.
 67. The method of claim 65, wherein: each datumrepresents a message; the child of a datum represents a reply to themessage represented by the datum; and the parent of a datum represents amessage, a reply to which is represented by the datum.
 68. The method ofclaim 65, wherein: each datum represents a container; the child of adatum represents a container within the container represented by thedatum; and the parent of a datum represents a container which containsthe container represented by the datum.
 69. At least one computerprogrammed to execute a process for tagging a datum in a hierarchicaldata set having a plurality of hierarchical levels and a plurality ofhierarchical depths, the process comprising: determining a hierarchicallevel of the datum; determining a hierarchical depth of the datum; andassigning a tag to the datum, comprising: determining the immediateparent of the datum; selecting a tag of the immediate parent of thedatum, wherein the tag is a number having multiple digits eachrepresenting one of the hierarchical depths of the hierarchical dataset; selecting a digit of the selected tag that represents thehierarchical depth of the datum; assigning a value to the selecteddigit, the value representing the hierarchical level of the datum. 70.The computer of claim 69, wherein assigning a value to the selecteddigit comprises: determining the number of children of the immediateparent of the datum that have already been tagged; incrementing thenumber of children to obtain an incremented number; and setting thevalue of the selected digit to equal the value of the incrementednumber.
 71. The computer of claim 69, wherein: each datum represents amessage; the child of a datum represents a reply to the messagerepresented by the datum; and the parent of a datum represents amessage, a reply to which is represented by the datum.
 72. The computerof claim 69, wherein: each datum represents a container; the child of adatum represents a container within the container represented by thedatum; and the parent of a datum represents a container which containsthe container represented by the datum.
 73. An apparatus for tagging adatum in a hierarchical data set having a plurality of hierarchicallevels and a plurality of hierarchical depths, the apparatus comprising:means for determining a hierarchical level of the datum; means fordetermining a hierarchical depth of the datum; and means for assigning atag to the datum, comprising: means for determining the immediate parentof the datum; means for selecting a tag of the immediate parent of thedatum, wherein the tag is a number having multiple digits eachrepresenting one of the hierarchical depths of the hierarchical dataset; means for selecting a digit of the selected tag that represents thehierarchical depth of the datum; means for assigning a value to theselected digit, the value representing the hierarchical level of thedatum.
 74. The apparatus of claim 73, wherein means for assigning avalue to the selected digit comprises: means for determining the numberof children of the immediate parent of the datum that have already beentagged; means for incrementing the number of children to obtain anincremented number; and means for setting the value of the selecteddigit to equal the value of the incremented number.
 75. The apparatus ofclaim 73, wherein: each datum represents a message; the child of a datumrepresents a reply to the message represented by the datum; and theparent of a datum represents a message, a reply to which is representedby the datum.
 76. The apparatus of claim 73, wherein: each datumrepresents a container; the child of a datum represents a containerwithin the container represented by the datum; and the parent of a datumrepresents a container which contains the container represented by thedatum.
 77. Computer-readable media embodying instructions executable bya computer to perform a method for tagging a datum in a hierarchicaldata set having a plurality of hierarchical levels and a plurality ofhierarchical depths, the method comprising: determining a hierarchicallevel of the datum; determining a hierarchical depth of the datum; andassigning a tag to the datum, comprising: determining the immediateparent of the datum; selecting a tag of the immediate parent of thedatum, wherein the tag is a number having multiple digits eachrepresenting one of the hierarchical depths of the hierarchical dataset; selecting a digit of the selected tag that represents thehierarchical depth of the datum; assigning a value to the selecteddigit, the value representing the hierarchical level of the datum. 78.The media of claim 77, wherein assigning a value to the selected digitcomprises: determining the number of children of the immediate parent ofthe datum that have already been tagged; incrementing the number ofchildren to obtain an incremented number; and setting the value of theselected digit to equal the value of the incremented number.
 79. Themedia of claim 77, wherein: each datum represents a message; the childof a datum represents a reply to the message represented by the datum;and the parent of a datum represents a message, a reply to which isrepresented by the datum.
 80. The media of claim 77, wherein: each datumrepresents a container; the child of a datum represents a containerwithin the container represented by the datum; and the parent of a datumrepresents a container which contains the container represented by thedatum.
 81. A unique tag for a datum in a hierarchical data set having aplurality of hierarchical levels and a plurality of hierarchical depths,comprising: a number having a plurality of digits, each digitrepresenting one of the hierarchical depths of the hierarchical dataset; and wherein the position of the least-significant non-zero digitrepresents the hierarchical depth of the datum; the value of theleast-significant non-zero digit represents the hierarchical level ofthe datum; and the digits that are more significant than theleast-significant non-zero digit represent parents of the datum.
 82. Amemory for storing data for access by an application program beingexecuted on a data processing system, comprising: a data structurestored in the memory, the data structure comprising a hierarchical dataset having a plurality of hierarchical levels and a plurality ofhierarchical depths, the hierarchical data set comprising a unique tagfor a datum comprising: a number having a plurality of digits, eachdigit representing one of the hierarchical depths of the hierarchicaldata set; and wherein the position of the least-significant non-zerodigit represents the hierarchical depth of the datum; the value of theleast-significant non-zero digit represents the hierarchical level ofthe datum; and the digits that are more significant than theleast-significant non-zero digit represent parents of the datum.